<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS函数</title>
</head>
<body>
<h2>自调用函数</h2>
<p id="demo"></p>
<script>
    (function (){
        document.getElementById("demo").innerHTML = "JavaScript函数";
    })();
</script>
</body>
</html>